import request from '@/utils/request'
import { getToken } from '../login'
import axios from '../../utils/axios'

// 查询车辆日志列表
export function listVehiclelog(query) {
  return request({
    url: '/wx/vehiclelog/list',
    method: 'get',
    params: query
  })
}

// 查询车辆日志详细
export function getVehiclelog(vehicleLogId) {
  return request({
    url: '/wx/vehiclelog/' + vehicleLogId,
    method: 'get'
  })
}

// 新增车辆日志
export function addVehiclelog(data) {
  return request({
    url: '/wx/vehiclelog',
    method: 'post',
    data: data
  })
}

// 修改车辆日志
export function updateVehiclelog(data) {
  return request({
    url: '/wx/vehiclelog',
    method: 'put',
    data: data
  })
}

// 删除车辆日志
export function delVehiclelog(vehicleLogId) {
  return request({
    url: '/wx/vehiclelog/' + vehicleLogId,
    method: 'delete'
  })
}

export function getCurrentLocation(carIdList) {
  return axios.post('https://api.ly-gps.com/lygps-api/v2/locate/getCarLocate',
    {
      carIdList: carIdList
    },
    {
      headers:{
        identityId:sessionStorage.getItem("identityId"),
        token:sessionStorage.getItem("token")
      }
    })
}
